<%@ page language="java" contentType="text/html; charset=utf-8"	pageEncoding="utf-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib tagdir="/WEB-INF/tags/sys" prefix="sys"%>
<%@ taglib uri="/WEB-INF/tlds/webui.tld" prefix="webui"%>
<c:set var="contextPath" value="${pageContext.request.contextPath}"	scope="request" />

<webui:enum var="menuEnum" code="MenuEnum" appendJs="true"/>

<jsp:include page="editInfo.jsp" />
<webui:panel id="listInfo">
	<form id="infoView" class="form-horizontal" v-cloak>
		<webui:input styleClass="col-sm-12 display-none" labelClass="col-sm-2" inputClass="col-sm-10"
			label="网页名称" type="label">{{info.header}}
		</webui:input>
		<webui:input styleClass="col-sm-12" labelClass="col-sm-2" inputClass="col-sm-10"
			label="站点标题" type="label">{{info.title}}
		</webui:input>
		<webui:input styleClass="col-sm-12" labelClass="col-sm-2" inputClass="col-sm-10"
			label="站点副标题(简称)" type="label">{{info.subTitle}}
		</webui:input>
		<webui:input styleClass="col-sm-12" labelClass="col-sm-2" inputClass="col-sm-10"
			label="版权描述" type="label">{{info.copyright}}
		</webui:input>
		<webui:input styleClass="col-sm-12" labelClass="col-sm-2" inputClass="col-sm-10"
			label="默认导航" type="label">{{info.defaultNavDesc}}
		</webui:input>
		<div class="form-group col-sm-12 display-none">
			<label class="control-label col-sm-2">现有FAV图标</label>
			<div class="lightBoxGallery col-sm-10" style="text-align:left">
				<a v-if="info.favicon" v-bind:href="'${contextPath}${sitePicPath}/'+info.favicon" title="图标" data-gallery>
					<img v-bind:src="'${contextPath}${sitePicPath}/'+info.favicon" height="auto" style="max-width:100%;">
				</a>
			</div>
		</div>
		<div class="form-group col-sm-12 ">
			<label class="control-label col-sm-2">
				现有ICON<br/>
				<a style="color:red" href="${contextPath}/img/chances/icon-explain.png" title="ICON说明" data-gallery>说明</a>
			</label>
			<div class="lightBoxGallery col-sm-10" style="text-align:left">
				<a v-if="info.icon" v-bind:href="'${contextPath}${sitePicPath}/'+info.icon" title="ICON" data-gallery>
					<img v-bind:src="'${contextPath}${sitePicPath}/'+info.icon" height="auto" style="max-width:100%;">
				</a>
			</div>
		</div>
		<div class="form-group col-sm-12 ">
			<label class="control-label col-sm-2">
				现有LOGO<br/>
				<a style="color:red" href="${contextPath}/img/chances/logo-explain.png" title="LOGO说明" data-gallery>说明</a>
			</label>
			<div class="lightBoxGallery col-sm-10" style="text-align:left;">
				<a v-if="info.logo" v-bind:href="'${contextPath}${sitePicPath}/'+info.logo" title="LOGO" data-gallery>
					<img v-bind:src="'${contextPath}${sitePicPath}/'+info.logo" height="auto" style="max-width:100%;">
				</a>
			</div>
		</div>
		<div class="col-md-3 text-right">
			<webui:button type="button" buttonClass="btn-primary" onclick="editInfo()">修改</webui:button>
		</div>
	</form>
</webui:panel>

<script>
	 var infoView =new Vue({
    	el:"#infoView",
    	data:{
    		info:{}
    	},
    	created:function(){ 
   	        this.load();
  		},
  		methods:{
			load:function(){
				var _self = this;
	   		 	$.ajax({
		 	 	    type:"GET",
		 	 	    async:false,
		 	 	    url:"${contextPath}/rest/mgmtInfoes/search/findFirstOrDeFault",
		 	 	    success:function(data){
		 	 	 	    if(data!=null){
			 	 	 	 	data['defaultNavDesc'] = menuEnum[data.defaultNav];
		 	 	    		_self.info = data;
		 	 	 	    }
		 	 	    }
		 	 	});
			 }
  		}
    });
</script>